//
//  HR_BLELinkTableViewCell.m
//  Pods
//
//  Created by xiaoming on 17/07/28.
//
//

#import "HR_BLELinkTableViewCell.h"

@interface HR_BLELinkTableViewCell ()

@property (weak, nonatomic) IBOutlet UILabel *perpheralNameLab;
@property (weak, nonatomic) IBOutlet UILabel *peripheralIdentifierLab;
@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *activityIndicatorView;

@end

@implementation HR_BLELinkTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

#pragma mark - ---------- Setter ----------
- (void)setPeripheral:(CBPeripheral *)peripheral {
    [self.perpheralNameLab setText:peripheral.name.length ? peripheral.name : @"未获取到设备名称"];
    [self.peripheralIdentifierLab setText:[NSString stringWithFormat:@"%@", peripheral.identifier]];
}

#pragma mark - ---------- Public ----------

- (void)activityIndicatorAnimating:(BOOL)animating {
    animating ? [self.activityIndicatorView startAnimating] : [self.activityIndicatorView stopAnimating];
}
@end
